<?php

class MY_Controller extends CI_Controller {

    var $_data = FALSE;
    var $container = 'container';

    public function __construct() {
        parent::__construct();
    }

    function display_view($path) {
        $this->before_render();
        $this->_data['load_path'] = $path;
        $this->load->view($this->container, $this->_data);
    }

    function before_render() {
        
    }

}

class FrontEnd_Controller extends MY_Controller {

    public function __construct() {
        parent::__construct();
        $header['page'] = 'home/header';
        $footer['page'] = "home/footer";
        $sidebar['page'] = "home/side_bar";
        $this->_data['sidebar'] = $sidebar;
        $this->_data['footer'] = $footer;
        $this->_data['header'] = $header;
    }

}

class Admin_Controller extends MY_Controller {

    var $_data = FALSE;
    var $container = "container";
    
    public function __construct() {
        parent::__construct();
        /* Admin controller custom code here :D */
        $header['page'] = "admin/header";
        $footer['page'] = "admin/footer";
        $sidebar['page'] = "admin/sidebar";
        $this->_data['sidebar'] = $sidebar;
        $this->_data['header'] = $header;
        $this->_data['footer'] = $footer;
        $this->container = 'admin/container';
    }

    function display_view($path) {
        $this->before_render();
        $this->_data['view_path'] = $path;
        $this->load->view($this->container, $this->_data);
    }

    function before_render() {
        
    }
}

?>